﻿using System;
using System.ComponentModel;
using System.Linq;
using ProjectEuler.Linq;

namespace ProjectEuler.Problems
{
    [EulerProblem(53, 4075)]
    [Description("How many values of C(n,r), for 1 ≤ n ≤ 100, exceed one-million?")]
    internal sealed class Problem053 : EulerProblem
    {
        public override Object Solve()
        {
            return (from n in (1).To(100)
                    from r in (1).To(n)
                    select Combinations.Count(n, r)).Count(c => c > 1000000);
        }
    }
}
